package com.lz.sports.bean

//本地数据库页
class PageList<T>(val page: Int, val pageCount: Int, val list:List<T>) {

    companion object {
        const val EMPTY = -1
        const val MORE = 0
        const val END = 1
    }

    val hasNext = list.size == pageCount

    val isFirstPage = page == 0

    val isRefreshing = false

    fun isEmpty(): Boolean = list.isEmpty()

    fun pageState(): Int {
        if (isFirstPage && list.isEmpty()) return EMPTY
        return if (hasNext) MORE else END
    }
}